<template>
	<view class="zone">
		<u-navbar :is-back="false"  :background="background" :border-bottom="false">
			<view class="slot-wrap">
				<view class="nav-bar">
					<u-icon class="back" size="20px"  @click="$p.back()" name="arrow-left"></u-icon>
					<text>往期详情</text>
				</view>
			</view>
		</u-navbar>

		<view class="main">
			<view class="marb" v-for="(item , index) in datalist" :key="index">
				<p class="qi">{{item.data}}</p>
				<view class="box">
					<view class="top">
						<view class="t_outside">
							<view>
								<p>本期共喂</p>
								<p><text>{{item.feed_nums}}</text>斤</p>
							</view>
						</view>
						<p class="line"></p>
						<view class="t_outside">
							<view>
								<p>可瓜分水晶</p>
								<p><text>{{item.pool}}</text>个</p>
							</view>
						</view>
					</view>
					<view class="titbox">
						<text>神兽</text>
						<text>本期斤数</text>
						<text>瓜分水晶</text>
					</view>
					<view class="list" v-for="(v , i) in item.sort.id" :key="i">
						<view class="anleft">
							<image :src="'http://img.cpgm.cc/panda/static/feed/' + v + '.png'" mode="widthFix" />
							<view v-if="i == 0 || i == 4 ">
								{{i == 0?'最大':'最小'}}
							</view>
						</view>
						<p class="cenp"> <text>{{item.sort.num[i]}}</text> 斤</p>
						<view class="anright" v-if="i == 0 || i == 4">
							<p> <text>{{i==0?item.max_pool:item.min_pool}}</text> 个</p>
							<p>每斤瓜分水晶{{i==0?item.max_per:item.min_per}}个</p>
						</view>
						<view class="anright" v-else>
							<p> <text>0</text> 个</p>
						</view>
					</view>

					<view class="bottombox">
						<view class="botbox">
							<view class="b_left">
								<text>本期瓜分水晶最多者</text>
							</view>
							<view class="more" @click="moreclick(item.user_sort)">查看更多</view>
						</view>

						<view class="rank">
						
							<view class="p_list" v-for="(item,index) in item.user_sort.slice(0, 3)" :key="index" :class="[index == 0?'bg1':index == 1?'bg2':index == 2?'bg3':'']">
								<view class="pl_left">
									<image class="lv" v-if=" index == 0 " src="http://img.cpgm.cc/panda/static/feed/one.png" mode="widthFix" />
									<image class="lv" v-if=" index == 1 " src="http://img.cpgm.cc/panda/static/feed/two.png" mode="widthFix" />
									<image class="lv" v-if=" index == 2 " src="http://img.cpgm.cc/panda/static/feed/three.png" mode="widthFix" />
									<view v-if="index > 2" class="lvbox">{{index + 1}}</view>
									<view class="header">
										<image :src="item.wx_img?item.wx_img :'http://img.cpgm.cc/panda/static/login/logo.png'" mode="widthFix" />
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>

			<view class="nonelog" v-if="datalist == ''">
				无记录，快去喂神兽分奖金吧
			</view>
		</view>
		
		<u-popup v-model="showpop" :mask-close-able="false" mode="bottom" border-radius="30px" :z-index="10000">
			<view class="pop">
				<image class="close" @click="showpop=false" src="http://img.cpgm.cc/panda/static/feed/cha.png"
					mode="widthFix" />
				<view class="p_top">
					<text>本期瓜分水晶最多者</text>
				</view>
				<scroll-view class="scroll_box" scroll-y>
					<view class="p_list2" v-for="(v,i) in ranklist" :key="i">
						<view class="pl_left">
							<image class="lv2" v-if=" i == 0 " src="http://img.cpgm.cc/panda/static/feed/one.png" mode="widthFix" />
							<image class="lv2" v-if=" i == 1 " src="http://img.cpgm.cc/panda/static/feed/two.png" mode="widthFix" />
							<image class="lv2" v-if=" i == 2 " src="http://img.cpgm.cc/panda/static/feed/three.png" mode="widthFix" />
							<view v-if="i > 2" class="lvbox">{{i + 1}}</view>
							<view class="header">
								<image :src="v.wx_img?  v.wx_img :'http://img.cpgm.cc/panda/static/login/logo.png'" mode="widthFix" />
							</view>
							<text>{{v.wx_nickname?v.wx_nickname:'潮玩新人'}}</text>
						</view>
						<view class="pl_r">
							<p><text>{{v.numbers}}</text>个</p>
						</view>
					</view>
					<view class="nonelog" v-if="ranklist == ''">
						无记录，快去喂神兽分奖金吧
					</view>
				</scroll-view>
			</view>
		</u-popup>

		<!-- <Userinfo :id="p_userid" :type="1" ref="info"></Userinfo> -->
	</view>
</template>

<script>
import config from '@/common/config/index'
	export default {
		data() {
			return {
				imgurl:config.imgurl,
				headerimgurl:config.headerimgurl,
				p_userid:'',
				showpop: false,
				datalist: '',
				ranklist:'',//排行榜列表
				background:{
					background:'#C7DDDA'
				}
			};
		},
		onLoad(){
			this.beforeLogs()
		},
		methods: {
			async beforeLogs() {
				let res = await this.$http.index.beforeLogs()
				this.datalist = res.data
			},
			// 查看更多水晶瓜分
			moreclick(list){	
				this.ranklist = list
				this.showpop = true
			},

			// 参看个人信息
			seeinfo(item){
				this.p_userid = String(item.u_id);
				setTimeout(() => {
					this.$refs.info.show()
				}, 100);
			},
		},
	}
</script>

<style lang="less">
.zone {
	min-height: 100vh;
	background: linear-gradient(180deg, #C7DDDA 0%, #C7DDDA 100%);
	background-size: 100% 100%;
}

	.main {
		padding: 12px;
	}

	.qi {
		color: #696969;
		font-size: 14px;
	}

	.box {
		margin-top: 10px;
		background: url('http://img.cpgm.cc/panda/static/feed/bg3.png');
		background-size: 100% 100%;
		padding: 10px;
	}		

	.top {
		display: flex;
		align-items: center;
		justify-content: space-between;

		.t_outside {
			width: 45%;
			display: flex;
			align-items: center;
			justify-content: center;

			image {
				width: 30px;
				margin-right: 5px;
			}
			view {
				display: flex;
				flex-direction: column;
				align-items: center;

			p:nth-child(1) {
				color: #696969;
				font-size: 12px;
			}

			p:nth-child(2) {
				color: #696969;
				font-size: 14px;

				text {
					font-weight: 600;
					color: #000000;
					font-size: 20px;
					margin-right: 2px;
				}
			}
		}
		}
		
	}

	.line {
		width: 1px;
		height: 30px;
		background: rgba(0, 0, 0, 0.2);
	}

	.titbox {
		padding: 10px;
		background: rgba(255, 255, 255, 0.6);
		border-radius: 5px;
		margin: 10px 0;
		display: flex;
		align-items: center;
		justify-content: space-between;

		text {
			width: 30%;
			text-align: center;
			color: #696969;
		}
	}

	.list {
		padding: 5px 10px;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 5px 0;
	}

	.anleft {
		width: 30%;
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;

		image {
			width: 60px;
		}

		view {
			width: 35px;
			height: 15px;
			font-size: 12px;
			line-height: 15px;
			text-align: center;
			position: absolute;
			background: rgba(0, 0, 0, 0.5);
			border-radius: 7px;
			top: 5%;
			right: 0%;
			color: #fff;
		}
	}

	.cenp {
		color: #000;
		font-size: 14px;

		text {
			font-size: 14px;
		}
	}

	.anright {
		width: 33%;
		display: flex;
		flex-direction: column;

		p:nth-child(1) {
			font-size: 12px;
			color: #000000;
			text-align: center;

			text {
				color: #000000;
				font-size: 14px;
				font-weight: 600;
			}
		}

		p:nth-child(2) {
			font-size: 12px;
			zoom: 0.9;
			color: #696969;
			text-align: center;
		}
	}

	.bottombox {
		background: #FFFFFF;
		border-radius: 5px;
		border: 1px solid #E1E1E1;
		margin-top: 10px;
		padding: 10px;
	}
	.botbox {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.b_left {
		display: flex;
		align-items: center;

		text {
			font-size: 14px;
			color: #000;
			line-height: 24px;
		}
	}

	.more {
		color: #000000;
		display: flex;
		align-items: center;
		font-size: 12px;
		margin-right: 5px;
	}

	.rank {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}


	// 弹出层

	.pop {
		background: linear-gradient(180deg, #C7DDDA 0%, #FFFFFF 100%);
		box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.1);
		padding: 20px 10px;
		position: relative;
	}
	.scroll_box {
		height: 50vh;
	}
	
	.p_list2 {
		background: #FFFFFF;
		border-radius: 7px;
		padding: 5px 10px;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom: 5px;
	}

	.p_top {
		display: flex;
		align-items: center;
		justify-content: center;
		margin-bottom: 10px;

		text {
			font-size: 18px;
			font-weight: bold;
			color: #343434;
			line-height: 33px;
		}
	}

	.p_tlt {
		background: rgba(255, 255, 255, 0.13);
		border-radius: 5px;
		padding: 10px;
		display: flex;
		align-items: center;
		justify-content: space-between;

		text {
			color: #C3C3C3;
		}
	}


	.lv {
		width: 25px;
		position: absolute;
		bottom: 25%;
		right: 25%;
		z-index: 99;
	}
	.lv2 {
		width: 30px;
	}

	.pl_left {
		display: flex;
		align-items: center;

		text {
			color: #fff;
			font-size: 14px;
		}
	}

	.close {
		width: 20px;
		position: absolute;
		top: 10px;
		right: 10px;
	}
.marb {
	margin-bottom: 12px;
	border-radius: 10px;
}



	.header {
			position: relative;
			top: -5px;
			width: 60px;
			height: 60px;
			display: flex;
			align-items: center;
			justify-content: center;
			margin: 0 10px;

			image {
				width: 55px;
				height: 55px;
				border-radius: 50%;
			}
		}


	.ddbox {
		width: 33%;
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.lvimg {
		width: 35px;
		z-index: 100;
		position: relative;
	}


.lvbox {
		width: 30px;
		height: 30px;
		text-align: center;
		line-height: 30px;
		color: #fff;
		font-size: 16px;
		font-weight: 600;
	}

.nonelog {
		color: rgba(255, 255, 255, .7);
		line-height: 50vh;
		font-size: 12px;
		text-align: center;
	}



	.p_list {
		position: relative;
		width: 30%;
		border-radius: 5px;
		margin: 5px 0;
		display: flex;
		align-items: center;
		justify-content: center;
		line-height: 0;
	}

	.pl_left {
		display: flex;
		align-items: center;

		text {
			color: #000;
			font-size: 13px;
		}
	}

	.header {
			position: relative;
			width: 60px;
			height: 60px;
			display: flex;
			align-items: center;
			justify-content: center;
			margin: 0 10px;

			image {
				width: 45px;
				height: 45px;
				border-radius: 50%;
			}
		}
		
		
	
	.pl_r {
		min-width: 30%;
		display: flex;
		align-items: center;
		flex-direction: column;

		p {
			font-size: 12px;
			color: #696969;
			text {
				color: #FF456B;
				font-size: 14px;
				font-weight: 600;
			}
		}
		p:nth-child(1) {
			color: #FF456B;
			font-size: 12px;
			margin-top: 2px;
		}
	}
	.lvbox {
		width: 30px;
		height: 30px;
		text-align: center;
		line-height: 30px;
		color: #343434;
		font-size: 16px;
		font-weight: 600;
	}

</style>